function getMeasure(url){

var ajax_load = "<img class='loading' src='./views/images/loading.gif'  alt='loading...' />";

$('#measurevalue').html(ajax_load);



var param=getMaesureParameters(url.toString());

$.ajax({
    url: './index.php',
    type: 'POST',
	data:"uri="+param[0]+"&endpoint="+param[1]+"&rt=measure/view",
    timeout: 1000,
	dataType:"json",
    error: function(){
        alert('No Observation exists...');
    },
    success: function(responseText){
	if(responseText.status==="ok"){
     fillInterfaceWithJsonObjectOfMeasure(responseText.measure,param);
	}
	else
	{
      alert('No measure exists...');
	}
    }
});


}


function fillInterfaceWithJsonObjectOfMeasure(measure,param){
 
  $('#measurevalue').html("");
	 var table=$(document.createElement('table')).addClass('measuretable').width('100%');
	 var tr=$(document.createElement('tr')).width('100%').hover(function ()
			{ $(this).addClass("hover");},  function () {$(this).removeClass("hover");});
     var td1=$(document.createElement('td'))
		 .addClass('title');
     td1.append("<span>"+measure.label+" Measure</span>");
	 tr.append(td1);
     var tr2=$(document.createElement('tr')).width('100%').hover(function ()
			{ $(this).addClass("hover");},  function () {$(this).removeClass("hover");});
	 var td2=$(document.createElement('td'))
		 .addClass('uri').html('URI (if de-referancable)');
	 var anchor=$(document.createElement('a'))
		 .attr('href',measure.URI);
	 var img=$(document.createElement('img'))
		 .attr('src','./views/images/external_link_icon.gif');
     anchor.append(img);
     td2.append(anchor);
	 tr2.append(td2);
     var tr3=$(document.createElement('tr')).width('100%').hover(function ()
			{ $(this).addClass("hover");},  function () {$(this).removeClass("hover");});
	 var td3=$(document.createElement('td'))
		 .addClass('comment').html(measure.comment);
	 tr3.append(td3);

	 table.append(tr);
  
	 table.append(tr2);
	 table.append(tr3);
	$('#measurevalue').append(table).append("<br/><br/>");

 }


function getMaesureParameters(url){
var arr=new Array();
 var split1=url.split('?');
 var split2=split1[1].split('&');
 for(i=0;i<split2.length;i++){
    var split3=split2[i].split('=');
	if(split3[0]=="uri"){
	  arr[0]=split3[1];
	}
	if(split3[0]=="endpoint"){
	  arr[1]=split3[1];
	}
	if(split3[0]=="rt"){
	  arr[2]=split3[1];
	}
 }

return arr;
}


